﻿using System;
using System.Text;

namespace Neoseeker.NAMFox.Tests
{
    /// <summary>
    /// Provides facilities for creating posts.
    /// </summary>
    public static class PostGenerator
    {
        private static Random r = new Random();

        /// <summary>
        /// Creates a random post string with enough characters
        /// to satisfy Neoseeker's minimum character limit for a post.
        /// </summary>
        /// <returns>Post text.</returns>
        public static string CreatePost()
        {
            StringBuilder sb = new StringBuilder();
            for (int i = 0; i < 100; i++)
            {
                if (i % 20 == 0)
                {
                    sb.Append(" ");
                }

                sb.Append((char)r.Next(32, 256));
            }

            return sb.ToString();
        }
    }
}
